﻿<Window x:Class="GaReporter.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:s="clr-namespace:System;assembly=mscorlib"
        xmlns:local="clr-namespace:GaReporter"
        xmlns:tools="clr-namespace:Tools"
        xmlns:fa="http://schemas.fontawesome.io/icons/"
        xmlns:res="clr-namespace:GaReporter.Properties"
        Height="600" Width="800"
	
>
	<Window.DataContext>
		<ObjectDataProvider ObjectType="{x:Type local:DocumentView}" MethodName="GetInstance"/>
	</Window.DataContext>
	
	<TabControl TabStripPlacement="Top" >
		
		<TabControl.Items>
			
			<TabItem Header="{x:Static res:Resources.ProjectPage}">
				<DockPanel LastChildFill="True">
					
					<ToolBarPanel DockPanel.Dock="Top">
						<ToolBarTray>
							<ToolBar>
								<ToolBar.Resources>
									<Style TargetType="fa:ImageAwesome">
										<Setter Property="SnapsToDevicePixels" Value="True"/>
										<Setter Property="Margin" Value="2"/>
										<Setter Property="Width" Value="28"/>
										<Setter Property="Height" Value="28"/>
									</Style>
								</ToolBar.Resources>
								
								<Button CommandParameter="{Binding}" Command="{local:OpenDocumentCommand}" ToolTip="{x:Static res:Resources.OpenDocumentButtonTooltip}">
									<fa:ImageAwesome SnapsToDevicePixels="True" Icon="FolderOpenOutlined" Foreground="DarkSlateGray"/>
								</Button>
								<Button CommandParameter="{Binding}" Command="{local:SaveDocumentCommand}" ToolTip="{x:Static res:Resources.SaveButtonTooltip}">
									<fa:ImageAwesome SnapsToDevicePixels="True" Icon="FloppyOutlined" Foreground="DarkSlateGray"/>
								</Button>
								<Button CommandParameter="{Binding}" Command="{local:SaveAsDocumentCommand}" ToolTip="{x:Static res:Resources.SaveAsButtonTooltip}">
									<Grid Width="28" Height="28" Margin="2" >
										<fa:ImageAwesome Margin="0" Icon="FloppyOutlined" Foreground="DarkSlateGray"/>
										<fa:ImageAwesome Margin="0" VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="16" Height="16" Icon="Pencil" Foreground="DarkSlateGray"/>
									</Grid>
								</Button>
								<Button CommandParameter="{Binding}" Command="{local:ReOpenDocumentCommand}" ToolTip="{x:Static res:Resources.ReloadButtonTooltip}">
									<fa:ImageAwesome SnapsToDevicePixels="True" Icon="Undo" Foreground="DarkSlateGray"/>
								</Button>
							
							</ToolBar>
						</ToolBarTray>
					</ToolBarPanel>
					
					
					<Grid>
						<StackPanel HorizontalAlignment="Stretch" DataContext="{Binding}" Orientation="Vertical">
							<StackPanel.Resources>
								<Style TargetType="DockPanel">
									<Setter Property="LastChildFill" Value="True"/>
								</Style>
								<Style TargetType="Grid">
									
									<Setter Property="VerticalAlignment" Value="Stretch"/>
									<Setter Property="HorizontalAlignment" Value="Stretch"/>
									<Setter Property="Margin" Value="3"/>
								</Style>
								<Style TargetType="TextBlock">
									
									<Setter Property="VerticalAlignment" Value="Top"/>
									<Setter Property="HorizontalAlignment" Value="Right"/>
									<Setter Property="FontWeight" Value="Black"/>
									<Setter Property="TextAlignment" Value="Right"/>
									<Setter Property="Padding" Value="4"/>
								</Style>
								<Style TargetType="TextBox">
									
									<Setter Property="VerticalAlignment" Value="Top"/>
									<Setter Property="HorizontalAlignment" Value="Stretch"/>
									<Setter Property="HorizontalContentAlignment" Value="Left"/>
									<Setter Property="VerticalContentAlignment" Value="Center"/>
									<Setter Property="TextWrapping" Value="Wrap"/>
									<Setter Property="BorderThickness" Value="1"/>
									<Setter Property="Padding" Value="2"/>
								</Style>
							</StackPanel.Resources>
							
							
							<Grid DataContext="{Binding}">
								
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="Auto"/>
									<ColumnDefinition/>
								</Grid.ColumnDefinitions>
								
								<Grid.RowDefinitions>
									<RowDefinition/>
									<RowDefinition/>
									<RowDefinition/>
								</Grid.RowDefinitions>
								
								<Grid Grid.Column="0" Grid.Row="0">
									<TextBlock Text="{x:Static res:Resources.OptionsKeyPathLabel}"/>
								</Grid>
								<Grid Grid.Column="1" Grid.Row="0">
									<TextBox Text="{Binding Path=KeyPath, UpdateSourceTrigger=PropertyChanged}" ToolTip="{x:Static res:Resources.OptionsKeyPathLabelTooltip}"/>
								</Grid>
								
								<Grid Grid.Column="0" Grid.Row="1">
									<TextBlock Text="{x:Static res:Resources.OptionsAccountEmailAddressLabel}"/>
								</Grid>
								<Grid Grid.Column="1" Grid.Row="1">
									<TextBox Text="{Binding Path=AccountEmailAddress, UpdateSourceTrigger=PropertyChanged}" ToolTip="{x:Static res:Resources.OptionsAccountEmailAddressLabelTooltip}"/>
								</Grid>
								
								<Grid Grid.Column="0" Grid.Row="2">
									<TextBlock Text="{x:Static res:Resources.OptionsIDsLabel}"/>
								</Grid>
								<Grid Grid.Column="1" Grid.Row="2">
									<TextBox Text="{Binding Path=IDs, UpdateSourceTrigger=PropertyChanged}" ToolTip="{x:Static res:Resources.OptionsIDsLabelTooltip}"/>
								</Grid>
							
							</Grid>
						
						</StackPanel>
					</Grid>
				
				
				</DockPanel>
			
			
			</TabItem>
			
			
			<TabItem Header="{x:Static res:Resources.FoldersPage}">
				
				<DockPanel LastChildFill="True" DataContext="{Binding}">
					
					<ToolBarPanel DockPanel.Dock="Top">
						<ToolBarTray>
							<ToolBar>
								<ToolBar.Resources>
									<Style TargetType="fa:ImageAwesome">
										<Setter Property="SnapsToDevicePixels" Value="True"/>
										<Setter Property="Margin" Value="2"/>
										<Setter Property="Width" Value="28"/>
										<Setter Property="Height" Value="28"/>
									</Style>
								</ToolBar.Resources>
								
								<Button CommandParameter="{Binding Path=FoldersView/}" Command="{local:RunFolderCommand}" ToolTip="{x:Static res:Resources.RefreshFolderButtonTooltip}">
									<fa:ImageAwesome SnapsToDevicePixels="True" Icon="PlayCircle" Foreground="ForestGreen"/>
								</Button>
								<Button CommandParameter="{Binding Path=FoldersView/}" Command="{local:OpenResultCommand}" ToolTip="{x:Static res:Resources.OpenButtonTooltip}">
									<fa:ImageAwesome SnapsToDevicePixels="True" Icon="Download" Foreground="DarkSlateGray"/>
								</Button>
								<Button CommandParameter="{Binding}" Command="{local:SaveDocumentCommand}" ToolTip="{x:Static res:Resources.SaveButtonTooltip}">
									<fa:ImageAwesome SnapsToDevicePixels="True" Icon="FloppyOutlined" Foreground="DarkSlateGray"/>
								</Button>
								<Button CommandParameter="{Binding}" Command="{local:ReOpenDocumentCommand}" ToolTip="{x:Static res:Resources.ReloadButtonTooltip}">
									<fa:ImageAwesome SnapsToDevicePixels="True" Icon="Undo" Foreground="DarkSlateGray"/>
								</Button>
								<Button CommandParameter="{Binding Path=FoldersView}" Command="{local:AddNewFolderCommand}" ToolTip="{x:Static res:Resources.AddNewFolderButtonTooltip}">
									<fa:ImageAwesome SnapsToDevicePixels="True" Icon="PlusCircle" Foreground="DarkSlateGray"/>
								</Button>
								<Button CommandParameter="{Binding Path=FoldersView}" Command="{local:RemoveFolderCommand}" ToolTip="{x:Static res:Resources.RemoveFolderButtonTooltip}">
									<fa:ImageAwesome SnapsToDevicePixels="True" Icon="MinusCircle" Foreground="DarkSlateGray"/>
								</Button>
								<Button CommandParameter="{Binding Path=FoldersView}" Command="{local:CloneFolderCommand}" ToolTip="{x:Static res:Resources.CloneFolderButtonTooltip}">
									<fa:ImageAwesome SnapsToDevicePixels="True" Icon="FilesOutlined" Foreground="DarkSlateGray"/>
								</Button>
							
							</ToolBar>
						</ToolBarTray>
					</ToolBarPanel>
					
					<Grid DataContext="{Binding Path=FoldersView}" Grid.Column="1" >
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="2*"/>
							
							<ColumnDefinition Width="5*"/>
						</Grid.ColumnDefinitions>
						
						
						<ListBox Grid.Column="0" ItemsSource="{Binding}"
						         IsSynchronizedWithCurrentItem="True"
						         DisplayMemberPath="Title" Margin="3,3,8,3" />
						
						
						<GridSplitter Grid.Column="0" Width="5"
						              VerticalAlignment="Stretch" HorizontalAlignment="Right" Background="Transparent"></GridSplitter>
						
						<DockPanel LastChildFill="True" Grid.Column="1" >
							
							<Grid DockPanel.Dock="Bottom" >
								<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
									<StackPanel.Resources>
										<Style TargetType="fa:ImageAwesome">
											<Setter Property="SnapsToDevicePixels" Value="True"/>
											<Setter Property="Margin" Value="2"/>
											<Setter Property="Width" Value="28"/>
											<Setter Property="Height" Value="28"/>
										</Style>
										
										<Style TargetType="Button">
											<!--<Setter Property="Padding" Value="2"/>-->
											<Setter Property="MinWidth" Value="100"/>
											<Setter Property="Margin" Value="3"/>
										</Style>
									</StackPanel.Resources>
									<Button CommandParameter="{Binding Path=/}" Command="{local:OpenResultCommand}" ToolTip="{x:Static res:Resources.OpenBigButtonTooltip}">
										<StackPanel Orientation="Horizontal">
											<fa:ImageAwesome SnapsToDevicePixels="True" Icon="Download" Foreground="DarkSlateGray"/>
											<TextBlock VerticalAlignment="Center" Padding="4" Text="{x:Static res:Resources.OpenBigButtonText}"/>
										</StackPanel>
									</Button>
									<Button CommandParameter="{Binding Path=/}" Command="{local:RunFolderCommand}" ToolTip="{x:Static res:Resources.RefreshFolderBigButtonTooltip}">
										<StackPanel Orientation="Horizontal">
											<fa:ImageAwesome SnapsToDevicePixels="True" Icon="PlayCircle" Foreground="ForestGreen"/>
											<TextBlock VerticalAlignment="Center" Padding="4" Text="{x:Static res:Resources.RefreshFolderBigButtonText}"/>
										</StackPanel>
									</Button>
								</StackPanel>
							</Grid>
							
							<StackPanel DataContext="{Binding}" Orientation="Vertical">
								<StackPanel.Resources>
									<Style TargetType="DockPanel">
										<Setter Property="LastChildFill" Value="True"/>
									</Style>
									<Style TargetType="Grid">
										
										<Setter Property="VerticalAlignment" Value="Stretch"/>
										<Setter Property="HorizontalAlignment" Value="Stretch"/>
										<Setter Property="Margin" Value="3"/>
									</Style>
									<Style TargetType="TextBlock">
										
										<Setter Property="VerticalAlignment" Value="Top"/>
										<Setter Property="HorizontalAlignment" Value="Right"/>
										<Setter Property="FontWeight" Value="Black"/>
										<Setter Property="TextAlignment" Value="Right"/>
										<Setter Property="Padding" Value="4"/>
									</Style>
									<Style TargetType="TextBox">
										
										<Setter Property="VerticalAlignment" Value="Top"/>
										<Setter Property="HorizontalAlignment" Value="Stretch"/>
										<Setter Property="HorizontalContentAlignment" Value="Left"/>
										<Setter Property="VerticalContentAlignment" Value="Center"/>
										<Setter Property="TextWrapping" Value="Wrap"/>
										<Setter Property="BorderThickness" Value="1"/>
										<Setter Property="Padding" Value="2"/>
									</Style>
									<Style TargetType="CheckBox">
										
										<Setter Property="VerticalAlignment" Value="Top"/>
										<Setter Property="HorizontalAlignment" Value="Left"/>
										<Setter Property="Margin" Value="2,6,0,0"/>
									</Style>
								</StackPanel.Resources>
								
								<Grid>
									
									<Grid.ColumnDefinitions>
										<ColumnDefinition Width="Auto"/>
										<ColumnDefinition/>
									</Grid.ColumnDefinitions>
									
									<Grid.RowDefinitions>
										<RowDefinition/>
										<RowDefinition/>
										<RowDefinition/>
										<RowDefinition/>
										<RowDefinition/>
										<RowDefinition/>
										<RowDefinition/>
										<RowDefinition/>
										<RowDefinition/>
										<RowDefinition/>
                                        <RowDefinition/>
                                        <RowDefinition/>

                                    </Grid.RowDefinitions>
									
									
									
									<Grid Grid.Column="0" Grid.Row="0">
										<TextBlock Text="{x:Static res:Resources.TitleLabel}"/>
									</Grid>
									<Grid Grid.Column="1" Grid.Row="0">
										<TextBox Text="{Binding Path=Title, UpdateSourceTrigger=PropertyChanged}" ToolTip="{x:Static res:Resources.TitleTooltip}"/>
									</Grid>
									
									<Grid Grid.Column="0" Grid.Row="1">
										<TextBlock Text="{x:Static res:Resources.FileNameLabel}"/>
									</Grid>
									<Grid Grid.Column="1" Grid.Row="1">
										
										<TextBox Text="{Binding Path=FileName, UpdateSourceTrigger=PropertyChanged}" ToolTip="{x:Static res:Resources.FileNameTooltip}"/>
									
									</Grid>
									
									<Grid Grid.Column="0" Grid.Row="2">
										<TextBlock Text="{x:Static res:Resources.StartDateLabel}"/>
									</Grid>
									<Grid Grid.Column="1" Grid.Row="2">
										<TextBox Text="{Binding Path=StartDate, UpdateSourceTrigger=PropertyChanged}" ToolTip="{x:Static res:Resources.StartDateTooltip}"/>
									</Grid>
									
									<Grid Grid.Column="0" Grid.Row="3">
										<TextBlock Text="{x:Static res:Resources.EndDateLabel}"/>
									</Grid>
									<Grid Grid.Column="1" Grid.Row="3">
										<TextBox Text="{Binding Path=EndDate, UpdateSourceTrigger=PropertyChanged}" ToolTip="{x:Static res:Resources.EndDateTooltip}"/>
									</Grid>
									
									<Grid Grid.Column="0" Grid.Row="4">
										<TextBlock Text="{x:Static res:Resources.MetricsLabel}"/>
									</Grid>
									<Grid Grid.Column="1" Grid.Row="4">
										<TextBox Text="{Binding Path=Metrics, UpdateSourceTrigger=PropertyChanged}" ToolTip="{x:Static res:Resources.MetricsTooltip}"/>
									</Grid>
									
									<Grid Grid.Column="0" Grid.Row="5">
										<TextBlock Text="{x:Static res:Resources.DimensionsLabel}"/>
									</Grid>
									<Grid Grid.Column="1" Grid.Row="5">
										<TextBox Text="{Binding Path=Dimensions, UpdateSourceTrigger=PropertyChanged}" ToolTip="{x:Static res:Resources.DimensionsTooltip}"/>
									</Grid>
									
									<Grid Grid.Column="0" Grid.Row="6">
										<TextBlock Text="{x:Static res:Resources.FiltersLabel}"/>
									</Grid>
									<Grid Grid.Column="1" Grid.Row="6">
										<TextBox Text="{Binding Path=Filters, UpdateSourceTrigger=PropertyChanged}" ToolTip="{x:Static res:Resources.FiltersTooltip}"/>
									</Grid>
									
									<Grid Grid.Column="0" Grid.Row="7">
										<TextBlock Text="{x:Static res:Resources.SegmentLabel}"/>
									</Grid>
									<Grid Grid.Column="1" Grid.Row="7">
										<TextBox Text="{Binding Path=Segment, UpdateSourceTrigger=PropertyChanged}" ToolTip="{x:Static res:Resources.SegmentTooltip}"/>
									</Grid>
									
									<Grid Grid.Column="0" Grid.Row="8">
										<TextBlock Text="{x:Static res:Resources.SortLabel}"/>
									</Grid>
									<Grid Grid.Column="1" Grid.Row="8">
										<TextBox Text="{Binding Path=Sort, UpdateSourceTrigger=PropertyChanged}" ToolTip="{x:Static res:Resources.SortTooltip}"/>
									</Grid>
									
									<Grid Grid.Column="0" Grid.Row="9">
										<TextBlock Text="{x:Static res:Resources.MaxResultsLabel}"/>
									</Grid>
									<Grid Grid.Column="1" Grid.Row="9">
										<TextBox Text="{Binding Path=MaxResults, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True, NotifyOnValidationError=True, TargetNullValue={x:Static s:String.Empty}}" ToolTip="{x:Static res:Resources.MaxResultsTooltip}"/>
									</Grid>

                                    <Grid Grid.Column="0" Grid.Row="10">
                                        <TextBlock Text="{x:Static res:Resources.DesampleLabel}"/>
                                    </Grid>
                                    <Grid Grid.Column="1" Grid.Row="10">
                                        <CheckBox IsThreeState="False" IsChecked="{Binding Path=Desample}" ToolTip="{x:Static res:Resources.DesampleTooltip}"/>
                                    </Grid>

                                    <Grid Grid.Column="0" Grid.Row="11">
                                        <TextBlock Text="{x:Static res:Resources.FullUpdateLabel}"/>
                                    </Grid>
                                    <Grid Grid.Column="1" Grid.Row="11">
                                        <CheckBox IsThreeState="False" IsChecked="{Binding Path=FullUpdate}" ToolTip="{x:Static res:Resources.FullUpdateTooltip}"/>
                                    </Grid>

                                </Grid>
							</StackPanel>
						</DockPanel>
					</Grid>
				
				</DockPanel>
			
			</TabItem>
			
			
			<TabItem Header="{x:Static res:Resources.RequestsPage}" IsSelected="True">
				
				
				
				<DockPanel LastChildFill="True" DataContext="{Binding}">
					
					<ToolBarPanel DockPanel.Dock="Top">
						<ToolBarTray>
							<ToolBar>
								<ToolBar.Resources>
									<Style TargetType="fa:ImageAwesome">
										<Setter Property="SnapsToDevicePixels" Value="True"/>
										<Setter Property="Margin" Value="2"/>
										<Setter Property="Width" Value="28"/>
										<Setter Property="Height" Value="28"/>
									</Style>
								</ToolBar.Resources>
								
								<Button CommandParameter="{Binding Path=FoldersView/RequestsView/}" Command="{local:RunRequestCommand}" ToolTip="{x:Static res:Resources.RefreshButtonTooltip}">
									<fa:ImageAwesome SnapsToDevicePixels="True" Icon="PlayCircle" Foreground="ForestGreen"/>
								</Button>
								<Button CommandParameter="{Binding Path=FoldersView/RequestsView/}" Command="{local:OpenResultCommand}" ToolTip="{x:Static res:Resources.OpenButtonTooltip}">
									<fa:ImageAwesome SnapsToDevicePixels="True" Icon="Download" Foreground="DarkSlateGray"/>
								</Button>
								<Button CommandParameter="{Binding}" Command="{local:SaveDocumentCommand}" ToolTip="{x:Static res:Resources.SaveButtonTooltip}">
									<fa:ImageAwesome SnapsToDevicePixels="True" Icon="FloppyOutlined" Foreground="DarkSlateGray"/>
								</Button>
								<Button CommandParameter="{Binding}" Command="{local:ReOpenDocumentCommand}" ToolTip="{x:Static res:Resources.ReloadButtonTooltip}">
									<fa:ImageAwesome SnapsToDevicePixels="True" Icon="Undo" Foreground="DarkSlateGray"/>
								</Button>
								<Button CommandParameter="{Binding Path=FoldersView/}" Command="{local:AddNewRequestCommand}" ToolTip="{x:Static res:Resources.AddNewButtonTooltip}">
									<fa:ImageAwesome SnapsToDevicePixels="True" Icon="PlusCircle" Foreground="DarkSlateGray"/>
								</Button>
								<Button CommandParameter="{Binding Path=FoldersView/}" Command="{local:RemoveRequestCommand}" ToolTip="{x:Static res:Resources.RemoveButtonTooltip}">
									<fa:ImageAwesome SnapsToDevicePixels="True" Icon="MinusCircle" Foreground="DarkSlateGray"/>
								</Button>
								<Button CommandParameter="{Binding Path=FoldersView/}" Command="{local:CloneRequestCommand}" ToolTip="{x:Static res:Resources.CloneButtonTooltip}">
									<fa:ImageAwesome SnapsToDevicePixels="True" Icon="FilesOutlined" Foreground="DarkSlateGray"/>
								</Button>
							
							</ToolBar>
						</ToolBarTray>
					</ToolBarPanel>
					
					<TabControl DisplayMemberPath="Title" TabStripPlacement="Top" DataContext="{Binding Path=FoldersView}" ItemsSource="{Binding}" IsSynchronizedWithCurrentItem="True" >
						<!-- <TabControl.ContextMenu>
							<ContextMenu>
								<ContextMenu.Items>
									<MenuItem Header="{x:Static res:Resources.AddNewFolder}" CommandParameter="{Binding}" Command="{local:AddNewFolderCommand}"/>
									<MenuItem Header="{x:Static res:Resources.RemoveFolder}" CommandParameter="{Binding}" Command="{local:RemoveFolderCommand}"/>
									<MenuItem Header="{x:Static res:Resources.CloneFolder}" CommandParameter="{Binding}" Command="{local:CloneFolderCommand}"/>
									<MenuItem Header="{x:Static res:Resources.RunFolder}" CommandParameter="{Binding Path=/}" Command="{local:RunFolderCommand}"/>
								</ContextMenu.Items>
							</ContextMenu>
						
						</TabControl.ContextMenu> -->
						
						<TabControl.ContentTemplate>
							<DataTemplate>
								<Grid DataContext="{Binding}" Grid.Column="1" >
									<Grid.ColumnDefinitions>
										<ColumnDefinition Width="2*"/>
										
										<ColumnDefinition Width="5*"/>
									</Grid.ColumnDefinitions>
									
									
									<ListBox Grid.Column="0" ItemsSource="{Binding Path=RequestsView}"
									         IsSynchronizedWithCurrentItem="True"
									         DisplayMemberPath="Title" Margin="3,3,8,3" />
									
									
									<GridSplitter Grid.Column="0" Width="5"
									              VerticalAlignment="Stretch" HorizontalAlignment="Right" Background="Transparent"></GridSplitter>
									
									<DockPanel LastChildFill="True" Grid.Column="1" >
										
										<Grid DockPanel.Dock="Bottom" >
											<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
												<StackPanel.Resources>
													<Style TargetType="fa:ImageAwesome">
														<Setter Property="SnapsToDevicePixels" Value="True"/>
														<Setter Property="Margin" Value="2"/>
														<Setter Property="Width" Value="28"/>
														<Setter Property="Height" Value="28"/>
													</Style>
													
													<Style TargetType="Button">
														<!--<Setter Property="Padding" Value="2"/>-->
														<Setter Property="MinWidth" Value="100"/>
														<Setter Property="Margin" Value="3"/>
													</Style>
												</StackPanel.Resources>
												<Button CommandParameter="{Binding Path=RequestsView/}" Command="{local:OpenResultCommand}" ToolTip="{x:Static res:Resources.OpenBigButtonTooltip}">
													<StackPanel Orientation="Horizontal">
														<fa:ImageAwesome SnapsToDevicePixels="True" Icon="Download" Foreground="DarkSlateGray"/>
														<TextBlock VerticalAlignment="Center" Padding="4" Text="{x:Static res:Resources.OpenBigButtonText}"/>
													</StackPanel>
												</Button>
												<Button CommandParameter="{Binding Path=RequestsView/}" Command="{local:RunRequestCommand}" ToolTip="{x:Static res:Resources.RefreshBigButtonTooltip}">
													<StackPanel Orientation="Horizontal">
														<fa:ImageAwesome SnapsToDevicePixels="True" Icon="PlayCircle" Foreground="ForestGreen"/>
														<TextBlock VerticalAlignment="Center" Padding="4" Text="{x:Static res:Resources.RefreshBigButtonText}"/>
													</StackPanel>
												</Button>
											</StackPanel>
										</Grid>
										
										<StackPanel DataContext="{Binding}" Orientation="Vertical">
											<StackPanel.Resources>
												<Style TargetType="DockPanel">
													<Setter Property="LastChildFill" Value="True"/>
												</Style>
												<Style TargetType="Grid">
													
													<Setter Property="VerticalAlignment" Value="Stretch"/>
													<Setter Property="HorizontalAlignment" Value="Stretch"/>
													<Setter Property="Margin" Value="3"/>
												</Style>
												<Style TargetType="TextBlock">
													
													<Setter Property="VerticalAlignment" Value="Top"/>
													<Setter Property="HorizontalAlignment" Value="Right"/>
													<Setter Property="FontWeight" Value="Black"/>
													<Setter Property="TextAlignment" Value="Right"/>
													<Setter Property="Padding" Value="4"/>
												</Style>
												<Style TargetType="TextBox">
													
													<Setter Property="VerticalAlignment" Value="Top"/>
													<Setter Property="HorizontalAlignment" Value="Stretch"/>
													<Setter Property="HorizontalContentAlignment" Value="Left"/>
													<Setter Property="VerticalContentAlignment" Value="Center"/>
													<Setter Property="TextWrapping" Value="Wrap"/>
													<Setter Property="BorderThickness" Value="1"/>
													<Setter Property="Padding" Value="2"/>
												</Style>
												<Style TargetType="CheckBox">
													
													<Setter Property="VerticalAlignment" Value="Top"/>
													<Setter Property="HorizontalAlignment" Value="Left"/>
													<Setter Property="Margin" Value="2,6,0,0"/>
												</Style>
											</StackPanel.Resources>
											
											<Grid>
												
												<Grid.ColumnDefinitions>
													<ColumnDefinition Width="Auto"/>
													<ColumnDefinition/>
												</Grid.ColumnDefinitions>
												
												<Grid.RowDefinitions>
													<RowDefinition/>
													<RowDefinition/>
													<RowDefinition/>
													<RowDefinition/>
													<RowDefinition/>
													<RowDefinition/>
													<RowDefinition/>
													<RowDefinition/>
													<RowDefinition/>
													<RowDefinition/>
													<RowDefinition/>
												
												</Grid.RowDefinitions>
												
												
												
												<Grid Grid.Column="0" Grid.Row="0">
													<TextBlock Text="{x:Static res:Resources.TitleLabel}"/>
												</Grid>
												<Grid Grid.Column="1" Grid.Row="0">
													<TextBox Text="{Binding Path=RequestsView/Title, UpdateSourceTrigger=PropertyChanged}" ToolTip="{x:Static res:Resources.TitleTooltip}"/>
												</Grid>
												
												<Grid Grid.Column="0" Grid.Row="1">
													<TextBlock Text="{x:Static res:Resources.FileNameLabel}"/>
												</Grid>
												<Grid Grid.Column="1" Grid.Row="1">
													
													<TextBox Text="{Binding Path=RequestsView/FileName, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" ToolTip="{x:Static res:Resources.FileNameTooltip}" x:Name="fileNameTextBox"/>
													<TextBlock IsHitTestVisible="False" Text="{Binding Path=FileName}" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="6,0,0,0" Foreground="DarkGray">
														<TextBlock.Style>
															<Style TargetType="{x:Type TextBlock}">
																<Setter Property="Visibility" Value="Collapsed"/>
																<Style.Triggers>
																	<DataTrigger Binding="{Binding Text, ElementName=fileNameTextBox}" Value="">
																		<Setter Property="Visibility" Value="Visible"/>
																	</DataTrigger>
																</Style.Triggers>
															</Style>
														</TextBlock.Style>
													</TextBlock>
												</Grid>
												
												<Grid Grid.Column="0" Grid.Row="2">
													<TextBlock Text="{x:Static res:Resources.StartDateLabel}"/>
												</Grid>
												<Grid Grid.Column="1" Grid.Row="2">
													<TextBox Text="{Binding Path=RequestsView/StartDate, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" ToolTip="{x:Static res:Resources.StartDateTooltip}" x:Name="startDateTextBox"/>
													<TextBlock IsHitTestVisible="False" Text="{Binding Path=StartDate}" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="6,0,0,0" Foreground="DarkGray">
														<TextBlock.Style>
															<Style TargetType="{x:Type TextBlock}">
																<Setter Property="Visibility" Value="Collapsed"/>
																<Style.Triggers>
																	<DataTrigger Binding="{Binding Text, ElementName=startDateTextBox}" Value="">
																		<Setter Property="Visibility" Value="Visible"/>
																	</DataTrigger>
																</Style.Triggers>
															</Style>
														</TextBlock.Style>
													</TextBlock>
												</Grid>
												
												<Grid Grid.Column="0" Grid.Row="3">
													<TextBlock Text="{x:Static res:Resources.EndDateLabel}"/>
												</Grid>
												<Grid Grid.Column="1" Grid.Row="3">
													<TextBox Text="{Binding Path=RequestsView/EndDate, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" ToolTip="{x:Static res:Resources.EndDateTooltip}" x:Name="endDateTextBox"/>
													<TextBlock IsHitTestVisible="False" Text="{Binding Path=EndDate}" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="6,0,0,0" Foreground="DarkGray">
														<TextBlock.Style>
															<Style TargetType="{x:Type TextBlock}">
																<Setter Property="Visibility" Value="Collapsed"/>
																<Style.Triggers>
																	<DataTrigger Binding="{Binding Text, ElementName=endDateTextBox}" Value="">
																		<Setter Property="Visibility" Value="Visible"/>
																	</DataTrigger>
																</Style.Triggers>
															</Style>
														</TextBlock.Style>
													</TextBlock>
												</Grid>
												
												<Grid Grid.Column="0" Grid.Row="4">
													<TextBlock Text="{x:Static res:Resources.MetricsLabel}"/>
												</Grid>
												<Grid Grid.Column="1" Grid.Row="4">
													<TextBox Text="{Binding Path=RequestsView/Metrics, UpdateSourceTrigger=PropertyChanged}" ToolTip="{x:Static res:Resources.MetricsTooltip}" x:Name="metricsTextBox"/>
													<TextBlock IsHitTestVisible="False" Text="{Binding Path=Metrics}" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="6,0,0,0" Foreground="DarkGray">
														<TextBlock.Style>
															<Style TargetType="{x:Type TextBlock}">
																<Setter Property="Visibility" Value="Collapsed"/>
																<Style.Triggers>
																	<DataTrigger Binding="{Binding Text, ElementName=metricsTextBox}" Value="">
																		<Setter Property="Visibility" Value="Visible"/>
																	</DataTrigger>
																</Style.Triggers>
															</Style>
														</TextBlock.Style>
													</TextBlock>
												</Grid>
												
												<Grid Grid.Column="0" Grid.Row="5">
													<TextBlock Text="{x:Static res:Resources.DimensionsLabel}"/>
												</Grid>
												<Grid Grid.Column="1" Grid.Row="5">
													<TextBox Text="{Binding Path=RequestsView/Dimensions, UpdateSourceTrigger=PropertyChanged}" ToolTip="{x:Static res:Resources.DimensionsTooltip}" x:Name="dimensionsTextBox"/>
													<TextBlock IsHitTestVisible="False" Text="{Binding Path=Dimensions}" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="6,0,0,0" Foreground="DarkGray">
														<TextBlock.Style>
															<Style TargetType="{x:Type TextBlock}">
																<Setter Property="Visibility" Value="Collapsed"/>
																<Style.Triggers>
																	<DataTrigger Binding="{Binding Text, ElementName=dimensionsTextBox}" Value="">
																		<Setter Property="Visibility" Value="Visible"/>
																	</DataTrigger>
																</Style.Triggers>
															</Style>
														</TextBlock.Style>
													</TextBlock>
												</Grid>
												
												<Grid Grid.Column="0" Grid.Row="6">
													<TextBlock Text="{x:Static res:Resources.FiltersLabel}"/>
												</Grid>
												<Grid Grid.Column="1" Grid.Row="6">
													<TextBox Text="{Binding Path=RequestsView/Filters, UpdateSourceTrigger=PropertyChanged}" ToolTip="{x:Static res:Resources.FiltersTooltip}" x:Name="filtersTextBox"/>
													<TextBlock IsHitTestVisible="False" Text="{Binding Path=Filters}" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="6,0,0,0" Foreground="DarkGray">
														<TextBlock.Style>
															<Style TargetType="{x:Type TextBlock}">
																<Setter Property="Visibility" Value="Collapsed"/>
																<Style.Triggers>
																	<DataTrigger Binding="{Binding Text, ElementName=filtersTextBox}" Value="">
																		<Setter Property="Visibility" Value="Visible"/>
																	</DataTrigger>
																</Style.Triggers>
															</Style>
														</TextBlock.Style>
													</TextBlock>
												</Grid>
												
												<Grid Grid.Column="0" Grid.Row="7">
													<TextBlock Text="{x:Static res:Resources.SegmentLabel}"/>
												</Grid>
												<Grid Grid.Column="1" Grid.Row="7">
													<TextBox Text="{Binding Path=RequestsView/Segment, UpdateSourceTrigger=PropertyChanged}" ToolTip="{x:Static res:Resources.SegmentTooltip}" x:Name="segmentTextBox"/>
													<TextBlock IsHitTestVisible="False" Text="{Binding Path=Segment}" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="6,0,0,0" Foreground="DarkGray">
														<TextBlock.Style>
															<Style TargetType="{x:Type TextBlock}">
																<Setter Property="Visibility" Value="Collapsed"/>
																<Style.Triggers>
																	<DataTrigger Binding="{Binding Text, ElementName=segmentTextBox}" Value="">
																		<Setter Property="Visibility" Value="Visible"/>
																	</DataTrigger>
																</Style.Triggers>
															</Style>
														</TextBlock.Style>
													</TextBlock>
												</Grid>
												
												<Grid Grid.Column="0" Grid.Row="8">
													<TextBlock Text="{x:Static res:Resources.SortLabel}"/>
												</Grid>
												<Grid Grid.Column="1" Grid.Row="8">
													<TextBox Text="{Binding Path=RequestsView/Sort, UpdateSourceTrigger=PropertyChanged}" ToolTip="{x:Static res:Resources.SortTooltip}" x:Name="sortTextBox"/>
													<TextBlock IsHitTestVisible="False" Text="{Binding Path=Sort}" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="6,0,0,0" Foreground="DarkGray">
														<TextBlock.Style>
															<Style TargetType="{x:Type TextBlock}">
																<Setter Property="Visibility" Value="Collapsed"/>
																<Style.Triggers>
																	<DataTrigger Binding="{Binding Text, ElementName=sortTextBox}" Value="">
																		<Setter Property="Visibility" Value="Visible"/>
																	</DataTrigger>
																</Style.Triggers>
															</Style>
														</TextBlock.Style>
													</TextBlock>
												</Grid>
												
												<Grid Grid.Column="0" Grid.Row="9">
													<TextBlock Text="{x:Static res:Resources.MaxResultsLabel}"/>
												</Grid>
												<Grid Grid.Column="1" Grid.Row="9">
													<TextBox Text="{Binding Path=RequestsView/MaxResults, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True, NotifyOnValidationError=True, TargetNullValue={x:Static s:String.Empty}}" ToolTip="{x:Static res:Resources.MaxResultsTooltip}"/>
												</Grid>
												
												<Grid Grid.Column="0" Grid.Row="10">
													<TextBlock Text="{x:Static res:Resources.DesampleLabel}"/>
												</Grid>
												<Grid Grid.Column="1" Grid.Row="10">
													<CheckBox IsThreeState="False" IsChecked="{Binding Path=RequestsView/Desample}" ToolTip="{x:Static res:Resources.DesampleTooltip}"/>
												</Grid>
											
											</Grid>
										</StackPanel>
									</DockPanel>
								</Grid>
							</DataTemplate>
						</TabControl.ContentTemplate>
					</TabControl>
				</DockPanel>
			
			</TabItem>
		
		
		</TabControl.Items>
	
	
	</TabControl>
</Window>